package br.hm.operandroid.manager;

import br.hm.operandroid.R;

public class OperatorUtils {

	private static String[] operators = {
			 "OI"
			,"TIM"
			,"VIVO"
			,"CLARO"
			,"GVT"
			,"EMBRATEL"
			,"INTELIG"
			,"TMAIS"
			,"NEXTEL"}; 
	private static int[] imageOperators = {
			 R.drawable.oi
			,R.drawable.tim
			,R.drawable.vivo
			,R.drawable.claro
			,R.drawable.gvt
			,R.drawable.embratel
			,R.drawable.intelig
			,R.drawable.tmais
			,R.drawable.nextel};
	
	public static int getImageResource(String name){
		for (int i = 0; i < operators.length; i++){
			String nameResource = operators[i];
			if (name.indexOf(nameResource) >= 0){
				return imageOperators[i];
			}
		}
		return R.drawable.operator;
	}
}
